package mjc.egg;
import mjc.compiler.*;
import mjc.gc.*;
import mg.egg.eggc.compiler.libjava.lex.*;
import mg.egg.eggc.compiler.libjava.messages.*;
import mg.egg.eggc.compiler.libjava.*;
import mg.egg.eggc.compiler.libjava.problem.IProblem;
import java.util.Vector;
public class S_EXTENSION_MJAVA {
LEX_MJAVA scanner;
  S_EXTENSION_MJAVA() {
    }
  S_EXTENSION_MJAVA(LEX_MJAVA scanner) {
    this.scanner = scanner;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  INFOClasse att_classe;
  TDS att_tds;
  LEX_MJAVA att_scanner;
  private void regle6() throws Exception {

    //declaration
    //appel
      action_init_6();
  }
  private void regle5() throws Exception {

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    T_MJAVA x_3 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_etend);
    x_3.analyser(LEX_MJAVA.token_ident);
      action_herit_5(x_3);
  }
private void action_init_6() throws Exception {
try {
// instructions
this.att_classe=null;
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_herit_5(T_MJAVA x_3) throws Exception {
try {
// locales
INFOClasse loc_i;
// instructions
loc_i=this.att_tds.chercherGlobalement(x_3.att_txt);
if ((loc_i!=null)){
this.att_classe=loc_i.heriter();
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMJAVAMessages.id_HERITAGE, MJAVAMessages.HERITAGE,new Object[]{""+x_3.att_txt});

}
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
  public void analyser () throws Exception {
    scanner.lit ( 1 ) ;
    switch ( scanner.fenetre[0].code ) {
      case LEX_MJAVA.token_etend : // 66287
        regle5 () ;
      break ;
      case LEX_MJAVA.token_aco : // 66272
        regle6 () ;
      break ;
      default :
               scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[0].getNom()});
    }
  }
  }
